package cn.tp.ksoft.civil_driver.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.widget.TextView;

import cn.tp.ksoft.civil_driver.R;

public class RegisterFinishDialog extends Dialog implements View.OnClickListener{
	private TextView mTitleTv;
	private TextView mContentTv;

	private DialogCallBack mCallBack;

	public RegisterFinishDialog(Context context) {
		this(context, R.style.style_common_custom_progress_dialog);
	}

	public RegisterFinishDialog(Context context, int theme) {
		super(context, theme);
		setContentView(R.layout.driver_dialog_reigister_finish);
		findViewById(R.id.btn_cancel).setOnClickListener(this);
		findViewById(R.id.btn_ok).setOnClickListener(this);
		mTitleTv = (TextView) findViewById(R.id.tv_title);
		mContentTv = (TextView) findViewById(R.id.tv_content);
	}

	public void setCallBack(DialogCallBack callBack) {
		this.mCallBack = callBack;
	}


	@Override
	public void onClick(View v) {
		switch (v.getId()) {
			case R.id.btn_cancel : {
				dismiss();
				if (null != mCallBack) {
					this.mCallBack.onNegativeClick();
				}
				this.mCallBack = null;
				break;
			}
			case R.id.btn_ok : {
				dismiss();
				if (null != mCallBack) {
					this.mCallBack.onPositiveClick();
				}
				this.mCallBack = null;
				break;
			}
 		}
	}
}
